<template>
    <div>
        <h2>练习2-请登陆</h2>
        <br/>
        <input placeholder="请输入用户名" v-model="username"/>
        <br/>
        <input placeholder="请输入密码" v-model="password" type="password"/>
        <br/>
        <button @click="loginHandler">登陆</button>
    </div>
</template>

<script>
    export default {
        name: "login",
        data() {
            return {
                username: '',
                password: ''
            }
        },
        methods: {
            loginHandler() {
                this.$emit("login", this.username, this.password)
            }
        }
    }
</script>

<style scoped>

</style>
